//lambda
fun main() {
    val getDiscountWords = configDiscountWords()
    println(getDiscountWords("沐浴露"))
}

//函数作为返回参数
fun configDiscountWords():(String) -> String{
    var currentYear = 2027
    var hour = (1..24).shuffled().last()
    //闭包
    return {goodsName:String ->
         "${currentYear}年，双11${goodsName}促销倒计时：${hour}小时"
    }
}